package com.neusoft.elmboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.neusoft.elmboot.po.Integrationlog;

@Mapper
public interface IntegrationlogMapper {

    @Insert("insert into integrationlog values(null, #{userId},1, #{time})")
    public int saveIntegrationlogByPay(Integrationlog il);

    @Select("select count(*) from integrationlog where userId = #{userId} and state = 1")
    public int getIntegrationlogByUserIdByTime(String userId, String time);
    
    public int deleteIntegrationlogByUserIdByTime(String userId, Integer count);
    
    @Delete("delete from integrationlog where time < #{limitTime} and userId = #{userId}")
    public int updateIntegrationlog(String userId, String limitTime);
    
    @Select("select count(*) from integrationlog where userId = #{userId} and time = #{limitTime}")
    public int getExpirationIntegrationlogByUserId(String userId, String limitTime);
}
